package com.imooc.long5zb.dao;

import com.imooc.long5zb.entity.MongoUser;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;

@Repository
public interface MongoUserRepository extends ReactiveMongoRepository<MongoUser, String> {

    Flux<MongoUser> findByAgeBetween(int strat, int end);

    @Query("{'age':{ '$gte': 15, '$lte' : 31}}")
    Flux<MongoUser> oldUser();

}
